<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>layout 后台大布局 - Layui</title>
<link rel="stylesheet" href="/layui-v2.0.1/layui/css/layui.css">
<link rel="stylesheet" href="/css/admin.css">

</head>
<body>

<div class="layui-layout layui-layout-admin">
    @include('admin.header')
  
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
       @include('admin.leftadmin')
    </div>
  </div>
  
  <div class="layui-body">
   <form class="layui-form" action="dochange" method="post" style="width:30%;margin-top: 20px">

     <div class="layui-form-item">
      <label class="layui-form-label">类型</label>
      <div class="layui-input-block">
        <select name="type" lay-filter="aihao" id="type">
          <option value="subscribe" >订阅号</option>
          <option value="service" selected="">服务号</option>
        </select>
      </div>
    </div>
    
    <div class="layui-form-item">
      <label class="layui-form-label">微信号</label>
      <div class="layui-input-block">
        <input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="公众号名称" class="layui-input" value="<?php echo $str['name']?>" lay-verify="required">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">原始ID</label>
      <div class="layui-input-block">
        <input type="text" name="account" lay-verify="required" placeholder="请输入gh_xxx格式的原始ID" autocomplete="off" class="layui-input" value="<?php echo $str['account']?>">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">AppId</label>
      <div class="layui-input-block">
        <input type="text" name="appid" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" value="<?php echo $str['appid']?>">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">AppSecret</label>
      <div class="layui-input-block">
        <input type="text" name="appsecret" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" value="<?php echo $str['appsecret']?>">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">Token</label>
      <div class="layui-input-block">
        <input type="text" name="token" lay-verify="required" placeholder="必须为英文或数字,长度为3-32字符" autocomplete="off" class="layui-input" value="<?php echo $str['token']?>">
      </div>
    </div>

    <div class="layui-form-item" pane="">
    <label class="layui-form-label">是否认证</label>
      <div class="layui-input-block" id="certifiedtwo">
        <input type="radio" name="certified" value="1" title="是" >
        <input type="radio" name="certified" value="0" title="否" checked="">
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn" lay-submit="" lay-filter="demo1">保存</button>
      </div>
    </div>
    <input type="hidden" id="typeone" value="<?php echo $str['type']?>">
    <input type="hidden" id="certifiedone" value="<?php echo $str['certified']?>">
</form>



  </div>
  <div class="layui-footer">
    <!-- 底部固定区域 -->
    © layui.com - 底部固定区域
  </div>
</div>
<script src="/layui-v2.0.1/layui/layui.js"></script>
</body>
</html>
<script>
  layui.use(['element','form'], function(){
    var element = layui.element;
    var form = layui.form
  
  });

  layui.use('jquery',function(){
    var $ = layui.jquery;
    $(function(){
      var type = $('#typeone').val();
      var certified = $('#certifiedone').val();
      $('#type').val(type);

      if(certified==1){
        $('#certifiedtwo').find('input').eq(0).attr('checked',true);
      }

      $('#certifiedtwo').val(certified);
    })
  })

</script>





